<?php


/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');

		echo "<form action='{$this->formAction}' method='post' name='adminForm' id='adminForm' enctype='multipart/form-data'>";
		?>
		<table class="adminheading">
		<tr>
			<th class='helpdesk_config'>
				<?php echo isset($this->pagetitle) ? $this->pagetitle : '' ?>
			</th>
		</tr>
		</table>

		<div id='onBeforeDisplay_wrapper'>
			<?php 
				$dispatcher = HelpDeskHelperPlugin::getInstance();
				$dispatcher->trigger( 'onBeforeDisplayConfigForm', array( $this->row, $this->user ) );
			?>
		</div>                

		<table class="invisible">
			<tbody>
                <tr>
					<td valign="top">

					<?php
					// display defaults
					$pane = '1';
					echo $this->sliders->startPane( "pane_$pane" );
					
					$legend = HelpDeskText::_( "Default Information" );
					echo $this->sliders->startPanel( HelpDeskText::_( $legend ), 'defaults' );
									
						echo '<table class="userlist">';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Show Dioscouri Link in Footer' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::booleanList( 'show_linkback', 'class="inputbox"', $this->config->get('show_linkback', '1') );
			                echo '</td>';
						echo '</tr>';
						echo '</table>';
						
					echo $this->sliders->endPanel();
					
					$legend = HelpDeskText::_( "Attachments" );
					echo $this->sliders->startPanel( HelpDeskText::_( $legend ), 'attachments' );
					
						echo '<table class="userlist">';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Enable Attachments' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::booleanList( 'files_enable', 'class="inputbox"', $this->config->get('files_enable', '1') );
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Maximum Size in KB' );
							echo '</td>';
			                echo '<td class="input">';
			                	echo "<input name='files_maxsize' type='text' class='text_area' size='50' value='".$this->config->get('files_maxsize', '3000')."' />";
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'File Storage Method' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::genericList( HelpDeskFile::getArrayListStorageMethods(), "files_storagemethod", "size='1' ", "value", "text", $this->config->get('files_storagemethod', '1') );
			                echo '</td>';
						echo '</tr>';
						echo '</table>';
						
					echo $this->sliders->endPanel();
					
					$legend = HelpDeskText::_( "Display" );
					echo $this->sliders->startPanel( HelpDeskText::_( $legend ), 'display' );
					
						echo '<table class="userlist">';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Require Login' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::booleanList( 'require_login', 'class="inputbox"', $this->config->get('require_login', '0') );
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Show Name or Email in Comments' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::genericList( HelpDeskHelperHelpDesk::getArrayListNameDisplay(), "display_name", "size='1' ", "value", "text", $this->config->get('display_name', '1') );
			                echo '</td>';
						echo '</tr>';
						echo '</table>';
						
					echo $this->sliders->endPanel();
					
					$legend = HelpDeskText::_( "Emails" );
					echo $this->sliders->startPanel( HelpDeskText::_( $legend ), 'emails' );
					
						echo '<table class="userlist">';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Default Sender Name' );
							echo '</td>';
			                echo '<td class="input">';
								echo "<input name='emails_defaultname' type='text' class='text_area' size='50' value='".$this->config->get('emails_defaultname', $this->lists->fromname )."' />";
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Default Sender Email' );
							echo '</td>';
			                echo '<td class="input">';
								echo "<input name='emails_defaultemail' type='text' class='text_area' size='50' value='".$this->config->get('emails_defaultemail', $this->lists->mailfrom )."' />";
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Include Description in Email Notices' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::booleanList( 'emails_includedescription', 'class="inputbox"', $this->config->get('emails_includedescription', '0') );
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Description Maximum Characters' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::integerList( '-1', '599', '150', 'emails_descriptionmaxlength', 'class="inputbox"', $this->config->get('emails_descriptionmaxlength', '-1') );
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Include Comments in Email Notices' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::booleanList( 'emails_includecomments', 'class="inputbox"', $this->config->get('emails_includecomments', '0') );
			                echo '</td>';
						echo '</tr>';
						echo '<tr>';
			            	echo '<td class="title">';
								echo HelpDeskText::_( 'Comments Maximum Length' );
							echo '</td>';
			                echo '<td class="input">';
								echo HelpDeskHTML::integerList( '-1', '599', '150', 'emails_commentmaxlength', 'class="inputbox"', $this->config->get('emails_commentmaxlength', '-1') );
			                echo '</td>';
						echo '</tr>';
						echo '</table>';
						
					echo $this->sliders->endPanel();
						
					// if there are plugins, display them accordingly
	                if ($this->items_sliders) 
	                {               	
                		$tab=1;
						$pane=2;
						for ($i=0, $count=count($this->items_sliders); $i < $count; $i++) {
							if ($pane == 1) {
								// echo $this->sliders->startPane( "pane_$pane" );
							}
							$item = $this->items_sliders[$i];
							echo $this->sliders->startPanel( HelpDeskText::_( $item->element ), $item->element );
							
							// load the plugin
								$import = HelpDeskHelperPlugin::importPlugin( strtolower( 'HelpDesk' ), $item->element );
							// fire plugin
								$dispatcher = HelpDeskHelperPlugin::getInstance();
								$dispatcher->trigger( 'onDisplayConfigFormSliders', array( $item, $this->row ) );
								
							echo $this->sliders->endPanel();
							if ($i == $count-1) {
								// echo $this->sliders->endPane();
							}
						}
					}
					
					echo $this->sliders->endPane();
					
					?>
					</td>
					<td valign="top">
					
						<div id='onDisplayRightColumn_wrapper'>
							<?php
								$dispatcher = HelpDeskHelperPlugin::getInstance();
								$dispatcher->trigger( 'onDisplayConfigFormRightColumn', array( $this->row, $this->user ) );
							?>
						</div>

					</td>
                </tr>
            </tbody>
		</table>

		<div id='onAfterDisplay_wrapper'>
			<?php 
				$dispatcher =& HelpDeskHelperPlugin::getInstance();
				$dispatcher->trigger( 'onAfterDisplayConfigForm', array( $this->row, $this->user ) );
			?>
		</div>
		
		<p>* <?php echo HelpDeskText::_( "or" )  . " " . $this->required->image . " " . HelpDeskText::_( 'Required Field' ); ?></p>

		<input type="hidden" name="option" value="<?php echo $this->formOption; ?>" />
		<input type="hidden" name="controller" value="<?php echo $this->formController; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="id" value="<?php echo $this->formId; ?>" />
		<input type="hidden" name="boxchecked" value="" />
		<input type="hidden" name="order" value="<?php echo @$this->order; ?>" />
		<input type="hidden" name="order_dir" value="<?php echo @$this->order_dir; ?>" />
        
		<?php
		echo $this->formValidate;
		echo "</form>";
		?>